<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<h3>우리들이 만든 영화</h3>
<hr align="left" width="150">
<center>
<table class="list">
	<thead>
		<tr>
			<th class="no">NO</th>
			<th class="title">제목</th>
			<th class="name">이름</th>
			<th class="date">작성일</th>
			<th class="hit">HIT</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="pvo"
			items="${requestScope.productionVO.productionList}">
			<tr>
				<td>${pvo.productionNo }</td>
				<td><a
					href="${initParam.root}production/content.do?productionNo=${pvo.productionNo }">${pvo.title
						}</a></td>
				<td>${pvo.mvo.nick }</td>
				<td>${pvo.date }</td>
				<td>${pvo.hit }</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
	<tr>
		<td align="left" colspan="5">
			<c:choose>
				<c:when test="${sessionScope.mvo==null}">
				</c:when>
				<c:otherwise>
					<a href="${initParam.root}production/write_view.do"><img src="${initParam.root}img/write_btn.jpg" border="0"></a>
				</c:otherwise>
			</c:choose>
		</td>
	</tr>
	<tr>
		<td align="center" colspan="5">
		<p class="paging">
		<!-- 코드량을 줄이기 위해 pb 변수에 페이징 빈을 담는다 -->
		<c:set var="pb" value="${requestScope.productionVO.pagingBean }"></c:set>
		<%-- ${pb.nowPage } --%>
		<!--  페이징빈의 getNowPage에 접근하여 출력 -->
		<c:if test="${pb.previousPageGroup==true }">
			<a href="${initParam.root}production/list.do?pageNo=${pb.startPageOfPageGroup-1}">◀</a>
		</c:if>
		<c:forEach var="i" begin="${pb.startPageOfPageGroup }" end="${pb.endPageOfPageGroup }">
		<c:choose>
			<c:when test="${i==pb.nowPage }">
			 ${i }
			</c:when>
			<c:otherwise>
				<a href="${initParam.root}production/list.do?pageNo=${i}">${i }</a>
			</c:otherwise>
		</c:choose>
		<%-- ${i } --%>
		</c:forEach>
		<c:if test="${pb.nextPageGroup==true }">
		<a href="${initParam.root}production/list.do?pageNo=${pb.endPageOfPageGroup+1}">▶</a>
		</c:if>
			</p>
		</td>
	</tr>		
	</tfoot>
</table>
</center>